﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using qna.pages;
using qna.Business;
using System.Web.UI.HtmlControls;

namespace EWDT
{
    public partial class Main : System.Web.UI.MasterPage
    {
        public User u = new User();

        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["username"] != null)
            {
                lblName.Text = u.UserName(Session["username"].ToString());
            }
			if (txtSearch.Text != "") {
				Response.Redirect("~/pages/SearchResults.aspx?searchString=" + txtSearch.Text);
			}
        }

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            if (txtSearch.Text != "")
            {
                Response.Redirect("~/pages/SearchResults.aspx?searchString=" + txtSearch.Text);
            }
        }
    }
}